﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class admin_news_news : System.Web.UI.Page
{
    public int Nid
    {
        get;
        set;
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("editNews"))
        {
            Nid = Convert.ToInt32(e.CommandArgument);
            Response.Redirect("modifyNews.aspx?nid="+Nid);
            Server.Transfer("modifyNews.aspx");
        }else
            if (e.CommandName.Equals("deleteNews"))
            {
                Nid = Convert.ToInt32(e.CommandArgument);
                DB db = new DB();
                db.deleteNews(Nid);
                Response.Redirect("news.aspx");
            }
    }
}
